#pragma once

struct POSITION{
	int x;
	int y;
};

enum KEY_ID{
	KEY_UP = 0x1, //
	KEY_DOWN= 0x2,
	KEY_LEFT = 0x4,
	KEY_RIGHT = 0x8,
	KEY_LP = 0x10,// light punch
	KEY_MP = 0x20,//mid
	KEY_HP =0x40,//heavy
	KEY_LK = 0x80,// Kick
	KEY_MK = 0x100,
	KEY_HK = 0x200,

	KEY_LEFT_UP = KEY_LEFT | KEY_UP,
	KEY_LEFT_DOWN = KEY_DOWN | KEY_LEFT,
	KEY_RIGHT_UP = KEY_UP | KEY_RIGHT,
	KEY_RIGHT_DOWN = KEY_RIGHT | KEY_DOWN,

	//KEY_BACK, //back will be left or right according the direction of plyer.
	//KEY_FRONT,//so front.

	KEY_NONE = 0,
	KEY_NUM = 10
};


const BYTE ERR_ID = 0xFF;

struct ACT_ID{
	BYTE data;
	ACT_ID(){data = 0xFF;}
	ACT_ID(BYTE ID_i){data = ID_i;}
	operator BYTE(){return data;}
};
inline bool operator== (const ACT_ID& ID_i, const ACT_ID& ID2_i) {return ID_i.data == ID2_i.data;}
inline bool operator< (const ACT_ID& ID_i, const ACT_ID& ID2_i) {return ID_i.data < ID2_i.data;}

struct BKG_ID{
	BYTE data;
	BKG_ID(){data = 0xFF;}
	BKG_ID(BYTE ID_i){data = ID_i;}
	operator BYTE(){return data;}

	UINT GetObjInfofileID(){return 0x200 + data;}
	UINT GetObjectPicID(){return (0x200 + data)<<8;}
};

struct FTR_ID{
	BYTE data;
	FTR_ID(){data = 0xFF;}
	FTR_ID(BYTE ID_i){data = ID_i;}
	operator BYTE(){return data;}

	UINT GetObjInfofileID(){return 0x100 + data;}
	UINT GetObjectPicID(){return (0x100 + data)<<8;}
};


struct PLR_ID{
	BYTE data;
	PLR_ID(){data = 0xFF;}
	PLR_ID(BYTE ID_i){data = ID_i;}
	operator BYTE(){return data;}
};

static PLR_ID _1P(0);
static PLR_ID _2P(1);


////////////////////////////////////////////////////
//global functions

void GetBitmapSize(HBITMAP hbmp_i, SIZE & size_o);
void GetBitmapSize(HBITMAP hbmp_i, int& W_o, int& H_o);
BOOL WINAPI StretchTransparentBlt(HDC hdcDest_i, int xoriginDest_i, int yoriginDest_i, int wDest_i, int hDest_i, 
								  HDC hdcSrc_i, int xoriginSrc_i, int yoriginSrc_i, int wSrc_i, int hSrc_i, int crTransparent);
